﻿
Partial Class Paginas_CuponEvento
    Inherits System.Web.UI.Page
    Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
        If Not Page.IsPostBack Then
            Dim EventoID As Integer = Request.QueryString("EventoID")

            Dim NegocioP As New dllNegocio.NegPersonas(System.Configuration.ConfigurationManager.AppSettings.Get("SPECBDD").ToString.Trim)
            Dim objUsr As New dllEntidades.clsFuncionario
            Try
                objUsr = NegocioP.BuscaPersona(Session("RutUsuario"))
                Me.lblNombre.Text = objUsr.Nombre & " " & objUsr.ApellidoPaterno & " " & objUsr.ApellidoMaterno
                Me.lblRut.Text = objUsr.Rut
            Catch ex As Exception
            Finally
                NegocioP.Dispose()
                NegocioP = Nothing
                objUsr.Dispose()
                objUsr = Nothing
            End Try

            Dim objNegEven As New dllNegocio.NegEventos(System.Configuration.ConfigurationManager.AppSettings.Get("SPECBDD"))
            Dim myCollect As Collection
            Dim objEven As New dllEntidades.clsEventos
            Try
                Me.lblCantiAsis.Text = Request("CantAsis")
                myCollect = objNegEven.ListarEventos(EventoID, "", 0)
                If myCollect.Count > 0 Then
                    objEven = myCollect.Item(1)
                    Me.lblNombreEvento.Text = objEven.Nombre
                    Me.lblTipAsistente.Text = objEven.TipoAsistente.Trim
                    Me.lblDescripcion.Text = objEven.DescripcionEvento

                    Dim objNegLugar As New dllNegocio.negLugares(System.Configuration.ConfigurationManager.AppSettings.Get("SPECBDD"))
                    Dim objLugar As New dllEntidades.clsLugares
                    Try
                        myCollect = objNegLugar.ListaLugaresVigente(objEven.CodigoLugar)
                        If myCollect.Count > 0 Then
                            objLugar = myCollect.Item(1)
                            Me.lblDireccion.Text = objLugar.Direccion
                            Me.lblLugar.Text = objLugar.NombreLugar
                            Me.lblEmail.Text = objLugar.Email
                            Me.lblTelefono.Text = objLugar.Telefono
                        End If
                    Catch exV2 As Exception
                    Finally
                        objNegLugar.Dispose()
                        objNegLugar = Nothing
                        objLugar.Dispose()
                        objLugar = Nothing
                    End Try
                End If

                Me.lblLit.Text = "<img src='img/ImgLoad/Eventos/" & objEven.ImagenMailEvento.ToString.Trim & "' alt='' height='400' width='500' />"
                Me.litImg.Text = "<img src='img/ImgLoad/Imagenes/" & objEven.Imagen.ToString.Trim & "' alt='' height='80' width='268' />"
            Catch ex As Exception
            Finally
                objNegEven.Dispose()
                objNegEven = Nothing
                myCollect = Nothing
                objEven.Dispose()
                objEven = Nothing
            End Try

        End If
    End Sub
End Class
